package com.xiaozhi.processor.factory;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

/**
 * BeanFactory的后置处理器
 */
@Component
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
	// [4]. 执行这里进行无参构造初始化
	public MyBeanFactoryPostProcessor() {
		System.out.println("MyBeanFactoryPostProcessor...");
	}

	// [5]. 执行BeanFactoryPostProcessor的postProcessBeanFactory方法
	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		System.out.println("BeanFactoryPostProcessor....postProcessBeanFactory==>" + beanFactory);
	}
}
